package com.lagou.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ToString
@Document(indexName = "lagou",type = "product",shards = 1,replicas = 1)
public class Product implements Serializable {
    @Id
    private Integer id;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String name;

    @Field(type = FieldType.Double)
    private Double price;

    @Field(type = FieldType.Keyword)
    private String flag;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String goodsDesc;

    @Field(type = FieldType.Keyword, index = false)
    private String images;

    @Field(type = FieldType.Integer)
    private Integer goodsStock;

    @Field(type = FieldType.Keyword)
    private String goodsType;
}
